package com.hydra.base.services;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.service.IService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hydra.base.entity.CodeEntity;
import com.hydra.base.entity.IdEntity;
import com.hydra.base.operate.log.entity.BaseOperateLogEntity;
import org.springframework.data.repository.NoRepositoryBean;

@NoRepositoryBean
public class BaseService<T extends IdEntity, M extends BaseMapper<T>> extends ServiceImpl<M, T> implements IService<T> {

    /**
     * 提供自定日志接口
     */
    public boolean enableOperateLog(T data, T history){
        return true;
    }

    /**
     * 处理操作日志
     */
    public void handleOperateLog(T data, T history){
    }

    /**
     * 获取操作日志的编码
     */
    public String getOperateLogCode(T data){
        return null;
    }

    /**
     * 保存操作日志
     */
    public void saveOperateLog(BaseOperateLogEntity operateLogInfo, T updateData, T historyData){
    }

}
